<%--
  Created by IntelliJ IDEA.
  User: c66
  Date: 2017/7/17
  Time: 21:23
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <head>
        <link rel="stylesheet" href="../../static/common/layui/css/layui.css">
        <link rel="stylesheet" href="../../static/css/global.css">
        <link rel="stylesheet" href="../../static/css/table.css">
        <script src="../../static/common/axios.min.js"></script>
        <script src="../../static/common/vue.min.js"></script>
        <script src="../../static/common/layui/layui.js"></script>
    <title>学校通知</title>
</head>
<body>
<div style="margin: 15px;"  id="Vue" v-cloak>
    <div v-show="show">
        <blockquote class="layui-elem-quote" >
            <a style="height: 10px;line-height: 28px;padding: 0 7px;font-size: 12px;"></a>
            <div style="float: right;">
                <input type="text" id="searchVal">
                <a href="javascript:;" class="layui-btn layui-btn-small" @click="search">
                    <i class="layui-icon">&#xe615;</i> 查询
                </a>
            </div>
        </blockquote>
        <fieldset class="layui-elem-field">
            <legend>学校通知</legend>
            <div class="layui-field-box layui-form">
                <table class="layui-table admin-table">
                    <thead>
                    <tr>
                        <th>通知标题</th>
                        <th>通知来源</th>
                        <th>发布日期</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <%--内容容器--%>
                    <tbody id="content">
                    </tbody>
                </table>
            </div>

        </fieldset>
        <%--分页容器--%>
        <div class="admin-table-page">
            <div id="paged" class="page">
            </div>
        </div>

</div>
    <div v-show="!show" v-cloak>
        <div class="layui-form-item"style="width:913px;">
            <label class="layui-form-label">通知标题</label>
            <div class="layui-input-block">
                <input type="text" name="title"    class="layui-input"  disabled="disabled" v-model="notice.title" >
            </div>
        </div>
        <div class="layui-form-item"style="width:913px;">
            <label class="layui-form-label">通知内容</label>
            <div class="layui-input-block">
                <div class="layui-textarea"  style="width:803px; height:400px" disabled="disabled" id="hello"></div>
            </div>
        </div>
        <div class="layui-form-item"style="width:913px;">
            <label class="layui-form-label">通知来源</label>
            <div class="layui-input-block">
                <input type="text" name="title"  class="layui-input"  disabled="disabled" v-model="notice.source">
            </div>
        </div>
        <div class="layui-form-item"style="width:913px;">
            <label class="layui-form-label">通知日期</label>
            <div class="layui-input-block">
                <input type="text" name="title"  class="layui-input" disabled="disabled" v-model="notice.publishdate">
            </div>
        </div>
        <div class="layui-form-item"style="width:913px;">
            <label class="layui-form-label">通知发布人</label>
            <div class="layui-input-block">
                <input type="text" name="composerName"  class="layui-input" disabled="disabled" v-model="composerName">
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <input type="button" class="layui-btn" @click="reload" value="返回">
            </div>
        </div>
</div>
</div>
<!--模板-->
<script type="text/html" id="tpl">
    {{# layui.each(d.data, function(index, item){ }}
    console.log(d.data);
    <tr>
        <td>{{ item.title || "-" }}</td>
        <td>{{ item.source || "-"}}</td>
        <td>{{ getYearMonthDate(item.publishdate) || "-"}}</td>
            <td>
            <%--<a href="javascript:;"   data-opt="edit" class9="layui-btn layui-btn-mini">编辑</a>--%>
            <%--<a href="javascript:;" data-opt="delete" class="layui-btn layui-btn-danger layui-btn-mini">删除</a>--%>
                <a href="javascript:;" target="_self" data-opt="details" data-id="{{item.id}}" class="layui-btn layui-btn-normal layui-btn-mini">预览详情</a>
           </td>
    </tr>
    {{# }); }}
</script>
<script src="../../static/js/student/schoolNotice.js"></script>
<script>
    var  publisherid = ${sessionScope.currentUser.getId()};
    var studentInfo = {};
    axios.get('/student/findDetail/'+publisherid)
        .then(function (response) {
            console.log(response.data.data);
            studentInfo = response.data.data.studentInfo;
        })
        .catch(function (msg) {
            console.log(msg);
        })
</script>
</body>
</html>
